﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ImageControl
{
    public partial class PreviewImage : UserControl
    {
        public event EventHandler OnDeleting;
        public event EventHandler OnDeletingEverything;
        public new event EventHandler OnClick;
        public PreviewImage()
        {
            InitializeComponent();
        }
        public Bitmap Image
        {
            get
            {
                return pictureBox.Image as Bitmap;
            }
            set
            {
                pictureBox.Image = value.Clone() as Bitmap;
            }
        }

        public String Label
        {
            get
            {
                return labelName.Text;
            }
            set
            {
                labelName.Text = value;
            }
        }

        private void löschenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OnDeleting(this, new EventArgs());
        }

        private void alleLöschenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OnDeletingEverything(this, new EventArgs());
        }

        private void pictureBox_Click(object sender, EventArgs e)
        {
            OnClick(this, e);   
        }

        
    }
}
